<?php

namespace App\Http\Controllers;

use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Session;
class BaseController extends Controller
{
    public function __construct()
    {
        //$this->initViewShare();    //视图共享数据
    }
    /**
     *  视图共享数据方法
     */
    public function initViewShare()
    {
        $userinfo = User::where("id",Session::get("userid"))->first();
        if($userinfo){
            //view()->share('account',$userinfo->account); //当前URL的方法器名

        }
        //$id = Session::get("userid");
    }
}
